<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<base href="__STATIC__/">
<link href="css/shop.css" type="text/css" rel="stylesheet" />
<link href="css/Sellerber.css" type="text/css"  rel="stylesheet" />
<link href="css/bkg_ui.css" type="text/css"  rel="stylesheet" />
<link href="font/css/font-awesome.min.css"  rel="stylesheet" type="text/css" />
<script src="js/jquery-1.9.1.min.js" type="text/javascript" ></script>
<script src="js/Sellerber.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery.cookie.js"></script>
<script src="js/shopFrame.js" type="text/javascript"></script>
<script src="js/layer/layer.js" type="text/javascript"></script>
<script src="js/laydate/laydate.js" type="text/javascript"></script>
<script src="js/dist/echarts.js" type="text/javascript"></script>
<!--[if lt IE 9]>
<script src="js/html5shiv.js" type="text/javascript"></script>
<script src="js/respond.min.js"></script>
<script src="js/css3-mediaqueries.js"  type="text/javascript"></script>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
  <![endif]-->
<title>退款操作</title>
</head>
<body>
 <div class="margin" id="page_style"> <div class="Promp_plate label-success same_module"><b>提示：</b>暂时只支持未发货的订单退款申请，已发货订单咋不支持退款换货，请敬请谅解。<a href="javascript:void()" class="fa fa-close close_Promp"></a></div>
    <!--<div class="refund_style " id="refund">-->
   		     <!---->
    		   <!--<div class="operation clearfix mb15  searchs_style">-->
       <!--<span class="l_f">-->
        <!--<a href="javascript:ovid()" class="btn  button_btn btn-danger"><i class="fa fa-trash"></i>批量删除</a>-->
        <!--<a href="javascript:ovid()" class="btn  button_btn bg-yellow"><i class="fa fa-credit-card"></i>已退款</a>-->
        <!--<a href="javascript:ovid()" class="btn  button_btn bg-green "><i class="fa  fa-credit-card-alt"></i>未退款</a>-->
       <!--</span>-->
     <!--</div>-->
       <div class=" datalist_show">
       <div class="datatable_height confirm">
        <table class="table table_list table_striped table-bordered">
           	<thead>
		 <tr>
				<th width="25px"><label><input type="checkbox" class="ace"><span class="lbl"></span></label></th>
				<th width="120px">订单编号</th>
				<th width="150px">产品名称</th>
				<th width="100px">交易金额</th>				
                <th width="100px">交易时间</th>				
				<th width="100px">退款金额</th>
                <th width="80px">数量</th>
                <th width="200px">说明</th>
				<th width="70px">退款状态</th>         
				<th width="200px">操作</th>
			</tr>
		</thead>
		 <tbody>
        <?php foreach($data as $val) { ?>
        <tr>
            <td><label><input type="checkbox" class="ace"><span class="lbl"></span></label></td>
            <td>zzb_<span><?= $val['o_id']?></span></td>
            <td><?= $val['g_name']?></td>
            <td><?php echo $val['g_price'] * $val['buy_num'] ?></td>
            <td>{$val.addtime|date="Y-m-d H:i:s",###}</td>
            <td id="return_money"><?php echo $val['g_price'] * $val['buy_num']?></td>
            <td><?= $val['buy_num']?></td>
            <td><?= $val['reason']?></td>

            <td class="td-status">
                <?php if($val['state']==0){ ?>
                <span class="label label-defaunt radius">未处理</span>
                <?php } ?>
            </td>
            <td class="td-manage">
                <span class="tui" where="<?= $val['u_id']?>">
                    <a  href="javascript:;"  title="直接退款"   class="btn btn-xs btn-status">直接退款</a>
                </span>

            </td>
        </tr>
         <?php } ?>
		 </tbody>
		</table>
	    </div>
	  </div>
    </div>
 </div>
</body>
</html>
<script type="text/javascript">
//设置内页框架布局


$(document).on("click",".tui",function(){
    var o_id = $(this).parents('tr').children().eq(1).children(1).text();
    var goods_price = $(this).parents('tr').children().eq(3).text();
    var user_id = $(this).attr('where');
    var sure = confirm("您真的要直接退款吗");
    var _this = $(this);
    if(sure == true){

        $.ajax({
            url:"{:url('index/Yang/edit1')}",
            data:{goods_price:goods_price,user_id:user_id,o_id:o_id},
            type:"post",
            success:function(e){
                if(e == 'success'){
                    _this.parents('tr').remove();
                }
            }
        })
    }else{
        return ;
    }
})












$(function() { 
	$("#refund").frame({
		float : 'left',
		Promp:'.close_Promp',//删除提示
		Sellerber_menu:'.list_content',
		datalist:".datatable_height",//数据列表高度取值
		header:65,//顶部高度
		mwidth:350,//宽度自定义
		minStatue:true,
		
	});
});





//
// function member_stop(obj,o_id){
//
//     var return_money = $("#return_money").html();
//     if($(obj).html()=='直接退款'){
//       var sure = confirm('确认要退款该商品吗？')
//         if(sure == true){
//             $.ajax({
//                 type: 'GET',
//                 url: '{:url("Yang/edit1")}',
//                 data:{o_id:o_id,return_money:return_money},
//                 success: function (res) {
//                     // console.log(res)
//                     // // if(res == 1){
//                     //     alert("退款成功")
//                     //     // $(obj).remove();
//                     //     // layer.msg('退款成功!',{icon:3 ,time:2000});
//                     //     // history.go(0)
//                     // // }
//                 }
//             })
//         }else{
//           alert(12321312)
//         }
//     }
//
// }


</script>
